﻿//EnvironmentUpdater interface implementation
//Author: Sam Nagar

//Includes.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;

//Begin Definition.
namespace EnvironmentUpdater
{
    //Service Contract Interface Definition.
    [ServiceContract]
    public interface EnvironmentUpdateService
    {
        //Method that returns the wind direction and updates the UI accordingly.
        [OperationContract]
        double reportAndUpdateWindDirection(EnvironmentUpdateSystem eSystem);

        //Method that updates the position of all planes in the back-end and on the UI.
        [OperationContract]
        void updateAndPostAllPlaneLocations(EnvironmentUpdateSystem eSystem);

        //Method that reports and updates the UI with the location of a single plane
        [OperationContract]
        void reportSinglePlaneLocation(EnvironmentUpdateSystem eSystem);
    }


    //Data Contract definition.
    [DataContract]
    public class EnvironmentUpdateSystem
    {
        //Instantiate radar and windsensors for the system to utilize.
        Radar radar = new Radar();
        WindSensor windSensor = new WindSensor();

        //Define basic data member class with getters and setters.
        [DataMember]
        public Radar eRadar
        {
            get { return radar; }
            set { radar = value; }
        }

        //Define basic data member class with getters and setters.
        [DataMember]
        public WindSensor eWindSensor
        {
            get { return windSensor; }
            set { windSensor = value; }
        }
    }
}




/*Old Example Code for Service Contract

 [OperationContract]
        string GetData(int value);

        [OperationContract]
        EnvironmentUpdateSystem GetDataUsingDataContract(EnvironmentUpdateSystem composite);

        // TODO: Add your service operations here


*/


/*Old Example code for Data Contract


bool boolValue = true;
        string stringValue = "Hello ";

        [DataMember]
        public bool BoolValue
        {
            get { return boolValue; }
            set { boolValue = value; }
        }

        [DataMember]
        public string StringValue
        {
            get { return stringValue; }
            set { stringValue = value; }
        }

*/